package com.xr.oa;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.xr.common.CommUtil;
import com.xr.system.User;

/**
 * datasetListener
 */
public class datasetListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {
	  SqlDataset ds = (SqlDataset) dataset;
	  DoradoContext context = DoradoContext.getContext();  
	  User user=(User)context.getAttribute(context.SESSION,"User");
		String className = dataset.parameters().getString("className");
		String sql = "";
		if (className != null && className.equals("todoRemindQuery_datasetList")) { //
			sql += ds.getSql();
			sql += CommUtil.setConditionSQL(ds); 
			ds.setSql(sql+" order by todo_name ");
		}
		if (className != null && className.equals("todoRemindQuery_datasetTODO")) { //
			sql += ds.getSql();
			sql += CommUtil.setConditionSQL(ds); 
			ds.setSql(sql);
		}
    return true;
  }

}
